package com.rongshu.view.home.listener;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;

/**
 * RecyclerView滑动监听
 * Created by yangle on 2017/10/12.
 */

public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {

    @Override
    public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
        super.onScrolled(recyclerView, dx, dy);
        if (!recyclerView.canScrollVertically(1) && dy > 0) {
            onLoadMore();
        }
    }

    /**
     * 加载更多回调
     */
    public abstract void onLoadMore();
}
